package org.example.kidscode.entity;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "reservation_setting")
public class ReservationSetting {

    @Id
    @Column(name = "setting_id", length = 20)
    private String settingId;

    @Column(name = "course_id", length = 10, nullable = false, unique = true)
    private String courseId;

    @Column(name = "max_reservations", nullable = false)
    private Integer maxReservations = 8;

    @Column(name = "min_reservations", nullable = false)
    private Integer minReservations = 3;

    @Column(name = "reservation_window", nullable = false)
    private Integer reservationWindow = 7;

    @Column(name = "cancel_deadline", nullable = false)
    private Integer cancelDeadline = 24;

    @Column(name = "auto_cancel_no_payment", columnDefinition = "tinyint(1) default 1")
    private Boolean autoCancelNoPayment = true;

    @Column(name = "payment_timeout")
    private Integer paymentTimeout = 30;

    @Column(name = "allow_waitlist", columnDefinition = "tinyint(1) default 1")
    private Boolean allowWaitlist = true;

    @Column(name = "waitlist_capacity")
    private Integer waitlistCapacity = 5;

    @Column(name = "status", nullable = false, columnDefinition = "tinyint(1) default 1")
    private Boolean status = true;

    @Column(name = "create_time", nullable = false, updatable = false, columnDefinition = "datetime default CURRENT_TIMESTAMP")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;

    @Column(name = "update_time", nullable = false, columnDefinition = "datetime default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

    // Getters and Setters
    public String getSettingId() {
        return settingId;
    }

    public void setSettingId(String settingId) {
        this.settingId = settingId;
    }

    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public Integer getMaxReservations() {
        return maxReservations;
    }

    public void setMaxReservations(Integer maxReservations) {
        this.maxReservations = maxReservations;
    }

    public Integer getMinReservations() {
        return minReservations;
    }

    public void setMinReservations(Integer minReservations) {
        this.minReservations = minReservations;
    }

    public Integer getReservationWindow() {
        return reservationWindow;
    }

    public void setReservationWindow(Integer reservationWindow) {
        this.reservationWindow = reservationWindow;
    }

    public Integer getCancelDeadline() {
        return cancelDeadline;
    }

    public void setCancelDeadline(Integer cancelDeadline) {
        this.cancelDeadline = cancelDeadline;
    }

    public Boolean getAutoCancelNoPayment() {
        return autoCancelNoPayment;
    }

    public void setAutoCancelNoPayment(Boolean autoCancelNoPayment) {
        this.autoCancelNoPayment = autoCancelNoPayment;
    }

    public Integer getPaymentTimeout() {
        return paymentTimeout;
    }

    public void setPaymentTimeout(Integer paymentTimeout) {
        this.paymentTimeout = paymentTimeout;
    }

    public Boolean getAllowWaitlist() {
        return allowWaitlist;
    }

    public void setAllowWaitlist(Boolean allowWaitlist) {
        this.allowWaitlist = allowWaitlist;
    }

    public Integer getWaitlistCapacity() {
        return waitlistCapacity;
    }

    public void setWaitlistCapacity(Integer waitlistCapacity) {
        this.waitlistCapacity = waitlistCapacity;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}